package com.dudu.dataImport;

import java.sql.Connection;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;

import org.apache.commons.lang.StringUtils;

/**
 * 同步APP应用账号与组织账号（异数据库）
 * @author gaoxs
 *
 */
public class PoolToAppUtil_update {
	/**
	 * 从sourceConn中t_app、t_account中根据条件导入到
	 * targetConn中的t_app_extend、t_account_extend
	 * @param sourceConn 源数据库连接
	 * @param targetConn 目的数据库连接
	 * @param appid   应用ID,多个使用逗号分隔
	 * @param query_create_time 按时间进行导入
	 * @param isfirst 是否首次导，是:true;否：false  
	 */
	public void dataConversion(Connection sourceConn,Connection targetConn,String appid,String query_begin_time, String query_end_time){
		Statement stmt = null;
		Statement stmt_rel = null;
		MyUtil myUtil = new MyUtil();
		int updatecount=0;
		try{
			stmt=sourceConn.createStatement();
			/*sql 拼接*/
			StringBuffer sql=new StringBuffer();
			sql.append("select id,is_init_account,is_app_validate from t_app  where 1=1");
			if(null != appid &&  appid.length()>0){ //只导部分应用
				sql.append(" and id in ("+appid+")");
			}
			sql.append(" order by id");
			System.out.println(sql.toString());
			/*执行查询*/
			ResultSet appresult = stmt.executeQuery(sql.toString());
			/*打印总条数*/
			appresult.last();//移到最后一行   
			int rowCount = appresult.getRow(); //得到当前行号，也就是记录数   
			appresult.beforeFirst(); //如果还要用结果集，就把指针再移到初始化的位置
			System.out.println("appresultsql="+sql.toString()+",resultCount="+rowCount);
			/*遍历appresult*/
			while (appresult.next()) {
				/*获取数据*/
				String app_id = myUtil.isNull(appresult.getString("id"));
				String is_init_account=myUtil.isNull(appresult.getString("is_init_account"));//使用统一推送地址
				String is_app_validate=myUtil.isNull(appresult.getString("is_app_validate"));//使用统一验证方式
				/*创建Statement*/
				stmt_rel=sourceConn.createStatement();
				/*拼接sql*/
				String sql1="select * from t_account where category='01' and app_id="+app_id;
				if(StringUtils.isNotBlank(query_begin_time) && StringUtils.isNotBlank(query_end_time)){
					sql1=sql1+" and create_time>='"+ query_begin_time+"'";
					sql1=sql1+" and create_time<='"+ query_end_time+"'";
				}
				sql1=sql1+" order by id";
				/*执行查询*/
				ResultSet accountresult=stmt_rel.executeQuery(sql1);
				/*打印总条数*/
				accountresult.last();//移到最后一行   
				int rowCount1 = accountresult.getRow(); //得到当前行号，也就是记录数   
				accountresult.beforeFirst(); //如果还要用结果集，就把指针再移到初始化的位置
				System.out.println("accountresultsql="+sql1.toString()+",resultCount="+rowCount1);
				/*遍历accountresult*/
				while(accountresult.next()){
					/*获取数据*/
					String id=myUtil.isNull(accountresult.getString("id"));//ID
					String account_type=myUtil.isNull(accountresult.getString("account_type"));//账号类型
					String identifier=myUtil.isNull(accountresult.getString("identifier"));//账号标识
					String product_code=myUtil.isNull(accountresult.getString("product_code"));//外系统编码
					String key_permanent=myUtil.isNull(accountresult.getString("key_permanent"));//公钥
					String key_temp=myUtil.isNull(accountresult.getString("key_temp"));//私钥
					String linker_name=myUtil.isNull(accountresult.getString("linker_name")).replace("'", "");//联系人姓名
					String linker_phone=myUtil.isNull(accountresult.getString("linker_phone"));//手机号
					String linker_email=myUtil.isNull(accountresult.getString("linker_email"));//邮箱
					String url_ticket=myUtil.isNull(accountresult.getString("callback_url"));//话单推送地址
					String url_callstatus=myUtil.isNull(accountresult.getString("call_status_url"));//会议状态推送地址
					String url_authentication=myUtil.isNull(accountresult.getString("authentication_url"));//鉴权地址
					if(url_authentication.endsWith("queryAccountInfo")){
						url_authentication=url_authentication.replace("queryAccountInfo", "verifyProductAccount");
					}
					String url_ivrdigit=myUtil.isNull(accountresult.getString("ivrdigit_url"));//ivr按键结果推送地址
					String billing_platform=myUtil.isNull(accountresult.getString("charging_type"));//计费平台
					String create_time=myUtil.isNull(accountresult.getString("create_time"));//创建时间
					String create_user=myUtil.isNull(accountresult.getString("create_user"));//创建人
					String cust_account=myUtil.isNull(accountresult.getString("custAccount"));//计费账号
					/*创建Statement*/
					Statement stmt0=targetConn.createStatement();
					
					if(null ==account_type){//判断是否为空
						System.out.println("正在导入id="+id+",identifier="+identifier+"时，导入账号失败，失败原因：account_type为空");
					}else if(account_type.indexOf("app")>-1){//应用账号导入
						try {
							/*判断导入时新表是否存在*/
							Boolean flag=this.isNewRow( stmt0, "t_app_extend", identifier, "", "", "");
							if(flag){
								/*拼接sql*/
								StringBuffer appsql=new StringBuffer();
								appsql.append("insert into t_app_extend(app_key,periphery_code,key_public,key_private,");
								appsql.append("linker_name,linker_phone,linker_email,is_init_url,is_init_validate,");
								appsql.append("url_ticket,url_callstatus,url_authentication,url_ivrdigit,");
								appsql.append("billing_platform,create_time,create_user) values ('");
								appsql.append(identifier).append("','").append(product_code).append("','").append(key_permanent).append("','").append(key_temp).append("','");
								appsql.append(linker_name).append("','").append(linker_phone).append("','").append(linker_email).append("','").append(is_init_account).append("','");
								appsql.append(is_app_validate).append("','").append(url_ticket).append("','").append(url_callstatus).append("','");
								appsql.append(url_authentication).append("','").append(url_ivrdigit).append("','").append(billing_platform).append("','").append(create_time).append("','");
								appsql.append(create_user).append("')");
								/*执行intsert命令*/
								System.out.println("instertappSQL="+appsql.toString());
								stmt0.executeUpdate(appsql.toString(),Statement.RETURN_GENERATED_KEYS);
								/*获取intsert的ID*/
								ResultSet keys = stmt0.getGeneratedKeys(); 
								if(keys.next()) {
									int appnewid=keys.getInt(1);
									System.out.println("正在导入id="+id+",identifier="+identifier+"时，导入app账号成功 ！！新表t_app_extend对应ID="+appnewid);
								}
								targetConn.commit();
							}else{
								System.out.println("正在导入id="+id+",identifier="+identifier+"时，导入app账号失败 ！！新表t_app_extend中存在此记录");
							}
							
						} catch (Exception e) {
							targetConn.rollback();
							targetConn.close();
							sourceConn.close();
					        stmt.close();
					        stmt_rel.close();
					        System.out.println("正在导入id="+id+",identifier="+identifier+"时，导入app账号失败，失败原因："+e.getMessage());
							e.printStackTrace();
						}
					}else if(account_type.indexOf("company")>-1){//组织账号导入 
						try {
							if(null==cust_account || cust_account.equals("")){
								System.out.println("正在导入id="+id+",identifier="+identifier+"时，导入company账号失败 ！！cust_account为空");
							}else{
								/*判断导入时新表是否存在*/
								Boolean flag=this.isNewRow( stmt0, "t_account_extend", cust_account, "", "", "");
								StringBuffer comsql=new StringBuffer();
								if(flag){
									/*拼接sql*/
									comsql.append("insert into t_account_extend (account_identify,cust_account,key_public,key_private,");
									comsql.append("linker_name,linker_phone,linker_email,");
									comsql.append("url_ticket,url_callstatus,url_authentication,url_ivrdigit,");
									comsql.append("billing_platform,create_time,create_user) values ('");
									comsql.append(identifier).append("','").append(cust_account).append("','").append(key_permanent).append("','").append(key_temp).append("','");
									comsql.append(linker_name).append("','").append(linker_phone).append("','").append(linker_email).append("','");
									comsql.append(url_ticket).append("','").append(url_callstatus).append("','");
									comsql.append(url_authentication).append("','").append(url_ivrdigit).append("','");
									comsql.append(billing_platform).append("','").append(create_time).append("','").append(create_user).append("')");
									/*执行intsert命令*/
									System.out.println("instertcomsqlSQL="+comsql.toString());
								}else{
									comsql.append("update t_account_extend set account_identify='"+identifier+"',");
									comsql.append("key_public='"+key_permanent+"'"+","+"key_private='"+key_temp+"'"+",");
									comsql.append("linker_name='"+linker_name+"'"+","+"linker_phone='"+linker_phone+"'"+",");
									comsql.append("linker_email='"+linker_email+"'"+","+"url_ticket='"+url_ticket+"'"+",");
									comsql.append("url_callstatus='"+url_callstatus+"'"+","+"url_authentication='"+url_authentication+"'"+",");
									comsql.append("billing_platform='"+billing_platform+"'"+","+"create_time='"+create_time+"'"+",");
									comsql.append("create_user='"+create_user+"'"+","+"url_ivrdigit='"+url_ivrdigit+"'");
									comsql.append("where cust_account='"+cust_account+"'");
									/*执行intsert命令*/
									System.out.println("updatecomsqlSQL="+comsql.toString());
									updatecount++;
								}
								stmt0.executeUpdate(comsql.toString(),Statement.RETURN_GENERATED_KEYS);
								/*获取intsert的ID*/
								ResultSet keys = stmt0.getGeneratedKeys(); 
								if(keys.next()) {
									int comnewid=keys.getInt(1);
									System.out.println("正在导入id="+id+",identifier="+identifier+"时，导入company账号成功 ！！新表t_account_extend对应ID="+comnewid);
								}
								targetConn.commit();
								
							}							
						} catch (Exception e) {
							targetConn.rollback();
							targetConn.close();
							sourceConn.close();
					        stmt.close();
					        stmt_rel.close();
					        System.out.println("正在导入id="+id+",identifier="+identifier+"时，导入company账号失败，失败原因："+e.getMessage());
							e.printStackTrace();
						}
					}else{
						System.out.println("正在导入id="+id+",identifier="+identifier+"时，导入账号失败，失败原因：account_type值错误(app,company),现值为："+account_type);
					}
				}
			}
			stmt.close();
		    stmt_rel.close();
		    targetConn.commit();
		    targetConn.close();
		    sourceConn.close();
		}catch(Exception e){
			try {
				targetConn.rollback();
				targetConn.close();
				sourceConn.close();
		        stmt.close();
		        stmt_rel.close();
			} catch (SQLException e1) {
				e1.printStackTrace();
			}
			e.printStackTrace();
		}
		System.out.println("此次执行共发现custAccount相同的数据为："+updatecount);
	}
	/**
	 * 判断导入时新表是否存在
	 * @param stmt0
	 * @param table
	 * @param keyvalue
	 * @return
	 * @throws Exception
	 */
	public static boolean isNewRow(Statement stmt0,String table,String keyvalue, String Caller, String Callee, String beginTime)throws Exception{
		String sql="select * from "+table;
		if(table.equals("t_app_extend")){
			sql=sql+" where app_key='"+keyvalue+"'";
		}else if(table.equals("t_account_extend")){
			sql=sql+" where cust_account='"+keyvalue+"'";
		}else if(table.equals("t_meet_info")){
			sql=sql+" where session_id='"+keyvalue+"'";
		}else if(table.equals("t_meet_ims_callback")){
			sql=sql+" where session_id='"+keyvalue+"' AND Caller='"+Caller+"' AND Callee='"+Callee+"' AND beginTime='"+beginTime+"' ";
		}
		/*执行查询*/
		ResultSet accountresult=stmt0.executeQuery(sql);
		/*打印总条数*/
		accountresult.last();//移到最后一行   
		int rowCount = accountresult.getRow(); //得到当前行号，也就是记录数   
		//System.out.println("**********"+sql+"------"+rowCount);
		if(rowCount>0){
			return false;
		}else{
			return true;
		}
	}
	
	/**
	 * 通话通话记录表和明细表
	 * @param sourceConn
	 * @param targetConn
	 * @param appid
	 * @param query_begin_time
	 * @param query_end_time
	 */
	public void billConversion(Connection sourceConn,Connection targetConn,String appid,String account_id,String query_begin_time, String query_end_time){
		Statement stmt = null;
		MyUtil myUtil = new MyUtil();
		int updatecount=0;
		try{
			stmt=sourceConn.createStatement();
			/*sql 拼接*/
			StringBuffer sql=new StringBuffer();
			sql.append(" 	SELECT");
			sql.append(" 	i.id,");
			sql.append(" 	a.identify AS 'app_key', ");
			sql.append(" 	t.custAccount AS 'cust_account',");
			sql.append(" 	u.user_identifer AS 'user_identify',");
			sql.append(" 	'GZQ' AS 'periphery_code',");
			sql.append(" 	i.caller AS 'caller',");
			sql.append(" 	i.phones AS 'called',");
			sql.append(" 	i.call_identifier AS 'session_id',");
			sql.append(" 	i.duration AS 'duration',");
			sql.append(" 	i.create_time AS 'create_time',");
			sql.append(" 	i.`status` AS 'status',");
			sql.append(" 	i.total_amount AS 'total_amount',");
			sql.append(" 	i.chargeNumber AS 'charge_number',");
			sql.append(" 	'3.0 sync' AS 'comments',");
			sql.append(" 	i.isAccepted AS 'is_accepted',");
			sql.append(" 	i.ability_type AS 'ability_type',");
			sql.append(" 	'' AS 'room_id'");
			sql.append(" FROM ");
			sql.append(" 	t_meet_ims i, t_app a, t_account t, t_company_user u");
			sql.append(" WHERE");
			sql.append(" 	i.app_id=a.id AND i.account_id=t.id AND i.user_id=u.id");
			sql.append("	AND i.create_time >= '"+query_begin_time+"' and i.create_time <= '"+query_end_time+"'");
			if(null != appid &&  appid.length()>0){ //只导部分应用
				sql.append(" AND i.app_id="+appid+" ");
			}
			if(null != account_id &&  account_id.length()>0){ //只导部分计费账号
				sql.append(" AND i.account_id="+account_id+" ");
			}
			sql.append(" order by id ");
			System.out.println(sql.toString());
			/*执行查询*/
			ResultSet appresult = stmt.executeQuery(sql.toString());
			/*打印总条数*/
			appresult.last();//移到最后一行   
			int rowCount = appresult.getRow(); //得到当前行号，也就是记录数   
			appresult.beforeFirst(); //如果还要用结果集，就把指针再移到初始化的位置
			System.out.println("meetIms resultsql="+sql.toString()+",resultCount="+rowCount);
			/*遍历appresult*/
			while (appresult.next()) {
				/*获取数据*/
				String app_key=myUtil.isNull(appresult.getString("app_key"));//appKey
				String cust_account=myUtil.isNull(appresult.getString("cust_account"));//计费账号
				String user_identify=myUtil.isNull(appresult.getString("user_identify"));//用户标识
				String periphery_code=myUtil.isNull(appresult.getString("periphery_code"));//外系统编码
				String caller=myUtil.isNull(appresult.getString("caller"));//主叫
				String called=myUtil.isNull(appresult.getString("called"));//被叫
				String session_id=myUtil.isNull(appresult.getString("session_id"));//会话标识
				String duration=myUtil.isNull(appresult.getString("duration"));//时长
				String create_time=myUtil.isNull(appresult.getString("create_time"));//创建时间
				String status=myUtil.isNull(appresult.getString("status"));//状态
				String total_amount=myUtil.isNull(appresult.getString("total_amount"));//会话人数
				String charge_number=myUtil.isNull(appresult.getString("charge_number"));//计费账号
				String comments=myUtil.isNull(appresult.getString("comments"));//备注
				String is_accepted=myUtil.isNull(appresult.getString("is_accepted"));//话单是否接收完成
				String ability_type=myUtil.isNull(appresult.getString("ability_type"));//能力类型
				String room_id="";

				if(!"1".equals(is_accepted)){
					is_accepted = "0";
				}
				
				/*创建Statement*/
				Statement stmt0=targetConn.createStatement();
				/*判断导入时新表是否存在*/
				Boolean flag=this.isNewRow( stmt0, "t_meet_info", session_id, "", "", "");
				if(flag){	
					try{
						/*拼接sql*/
						StringBuffer appsql=new StringBuffer();
						appsql.append("insert into t_meet_info(app_key,cust_account,user_identify,periphery_code,caller,");
						appsql.append("called,session_id,duration,create_time,status,");
						appsql.append("total_amount,charge_number,comments,is_accepted,ability_type,");
						appsql.append("room_id) values ('");
						appsql.append(app_key).append("','").append(cust_account).append("','").append(user_identify).append("','").append(periphery_code).append("','");
						appsql.append(caller).append("','").append(called).append("','").append(session_id).append("','").append(duration).append("','");
						appsql.append(create_time).append("','").append(status).append("','").append(total_amount).append("','");
						appsql.append(charge_number).append("','").append(comments).append("','").append(is_accepted).append("','").append(ability_type).append("','");
						appsql.append(room_id).append("')");
						/*执行intsert命令*/
						//System.out.println("inster t_meet_info SQL="+appsql.toString());
						stmt0.executeUpdate(appsql.toString(),Statement.RETURN_GENERATED_KEYS);
						/*获取intsert的ID*/
						ResultSet keys = stmt0.getGeneratedKeys(); 
						if(keys.next()) {
							int appnewid=keys.getInt(1);
							//System.out.println("正在导入session_id="+session_id+",，导入app账号成功 ！！新表t_meet_info对应ID="+appnewid);
						}
						targetConn.commit();
						
						/*拼接sql*/
						StringBuffer callbacksql=new StringBuffer();
						callbacksql.append(" SELECT session_id, beginTime, endTime, time, fee,");
						callbacksql.append("	Caller, Callee, chargeNumber, displayNbr, comments, ");
						callbacksql.append("	ability_type, meet_AccessPhone, meet_CreatedTime, meet_ColsedTime, meet_OrganizationId");
						callbacksql.append(" FROM t_meet_ims_callback ");
						callbacksql.append(" WHERE session_id='"+session_id+"'");
						/*创建Statement*/
						Statement stmt1=sourceConn.createStatement();/*执行查询*/
						try{
							ResultSet callbackresult = stmt1.executeQuery(callbacksql.toString());
							/*打印总条数*/
							callbackresult.last();//移到最后一行   
							int callbackCount = callbackresult.getRow(); //得到当前行号，也就是记录数   
							callbackresult.beforeFirst(); //如果还要用结果集，就把指针再移到初始化的位置
							while (callbackresult.next()) {
								/*获取数据*/
								String session_id_callback=myUtil.isNull(callbackresult.getString("session_id"));//session_id
								String beginTime=myUtil.isNull(callbackresult.getString("beginTime"));//开始时间
								String endTime=myUtil.isNull(callbackresult.getString("endTime"));//结束时间
								String time=myUtil.isNull(callbackresult.getString("time"));//时长
								String fee=myUtil.isNull(callbackresult.getString("fee"));//费用
								String Caller=myUtil.isNull(callbackresult.getString("Caller"));//主叫
								String Callee=myUtil.isNull(callbackresult.getString("Callee"));//被叫
								String chargeNumber=myUtil.isNull(callbackresult.getString("chargeNumber"));//计费账号
								String displayNbr=myUtil.isNull(callbackresult.getString("displayNbr"));//显号
								String comments_callback=myUtil.isNull(callbackresult.getString("comments"));//备注
								String ability_type_callback=myUtil.isNull(callbackresult.getString("ability_type"));//能力类型
								String meet_AccessPhone=myUtil.isNull(callbackresult.getString("meet_AccessPhone"));//
								String meet_CreatedTime=myUtil.isNull(callbackresult.getString("meet_CreatedTime"));//
								String meet_ColsedTime=myUtil.isNull(callbackresult.getString("meet_ColsedTime"));//
								String meet_OrganizationId=myUtil.isNull(callbackresult.getString("meet_OrganizationId"));//
								
								/*创建Statement*/
								Statement stmt2=targetConn.createStatement();
								try{
									Boolean flag1=this.isNewRow(stmt2, "t_meet_ims_callback", session_id, Caller, Callee, beginTime);
									if(flag1){	
										/*拼接sql*/
										StringBuffer callDetailsql=new StringBuffer();
										callDetailsql.append("insert into t_meet_ims_callback(session_id,beginTime,endTime,time,fee,");
										callDetailsql.append("Caller,Callee,chargeNumber,displayNbr,comments,");
										callDetailsql.append("ability_type,meet_AccessPhone,meet_CreatedTime,meet_ColsedTime,meet_OrganizationId");
										callDetailsql.append(") values ('");
										callDetailsql.append(session_id_callback).append("','").append(beginTime).append("','").append(endTime).append("','").append(time).append("','");
										callDetailsql.append(fee).append("','").append(Caller).append("','").append(Callee).append("','").append(chargeNumber).append("','");
										callDetailsql.append(displayNbr).append("','").append(comments_callback).append("','").append(ability_type_callback).append("','");
										callDetailsql.append(meet_AccessPhone).append("','").append(meet_CreatedTime).append("','").append(meet_ColsedTime).append("','").append(meet_OrganizationId).append("')");
										/*执行intsert命令*/
										//System.out.println("inster t_meet_ims_callback SQL="+callDetailsql.toString());
										stmt2.executeUpdate(callDetailsql.toString(),Statement.RETURN_GENERATED_KEYS);
										/*获取intsert的ID*/
										ResultSet keys2 = stmt2.getGeneratedKeys(); 
										if(keys2.next()) {
											int appnewid=keys2.getInt(1);
											//System.out.println("正在导入session_id="+session_id+",，导入t_meet_ims_callback成功 ！！新表t_meet_ims_callback对应ID="+appnewid);
										}
										targetConn.commit();
									}
									
									stmt2.close();
								}catch(Exception e){
									stmt2.close();
							        System.out.println("正在导入session_id="+session_id+",导入t_meet_info账号失败，失败原因："+e.getMessage());
								}
							}

							stmt1.close();
						}catch(Exception e){
							stmt1.close();
					        System.out.println("正在导入session_id="+session_id+",导入t_meet_info账号失败，失败原因："+e.getMessage());
						}
						
						stmt0.close();
					}catch(Exception e){
						stmt0.close();
				        System.out.println("正在导入session_id="+session_id+",导入t_meet_info账号失败，失败原因："+e.getMessage());
					}
				}else{
					System.out.println("正在导入session_id="+session_id+",t_meet_info中存在此记录");
				}
			}
			stmt.close();
		    targetConn.commit();
		    targetConn.close();
		    sourceConn.close();
		}catch(Exception e){
			try {
				targetConn.rollback();
				targetConn.close();
				sourceConn.close();
		        stmt.close();
			} catch (SQLException e1) {
				e1.printStackTrace();
			}
			e.printStackTrace();
		}
		System.out.println("此次执行共发现custAccount相同的数据为："+updatecount);
	}
	
	public static void main(String[] args) {
		/*源*/
		String sourceUrl="jdbc:mysql://123.56.31.231:9596/voip_plat_version3?useUnicode=true&amp;characterEncoding=UTF-8";//"jdbc:mysql://182.92.147.67:3306/voip_plat_version3?useUnicode=true&amp;characterEncoding=UTF-8";
		String sourceUsername="root";//"dudu_manager";
		String sourcePassword="lofjel(lkKe839*J2@3";//"Ukefj93r*93kfle";
		/*目的*/
		String targetUrl="jdbc:mysql://123.56.31.231:9596/voip_plat_version4?useUnicode=true&amp;characterEncoding=UTF-8";//"jdbc:mysql://182.92.147.67:3306/voip_plat_version4?useUnicode=true&amp;characterEncoding=UTF-8";
		String targetUsername="root";//"dudu_manager";
		String targetPassword="lofjel(lkKe839*J2@3";//"Ukefj93r*93kfle";
		String appid="43";//"87,72";//应用ID 多个时使用逗号分隔87,72
		String accountid="";
		String create_time_begin="2016-08-03";
		String create_time_end="2016-11-03";
		
		/*创建连接*/
		DBConnectionUtil dbUtil = new DBConnectionUtil();
		Connection sourceConn = dbUtil.getDBConnection(sourceUrl,sourceUsername,sourcePassword);
		Connection targetConn = dbUtil.getDBConnection(targetUrl, targetUsername, targetPassword);
		/*执行*/
		PoolToAppUtil_update util=new PoolToAppUtil_update();
		//util.dataConversion(sourceConn, targetConn, appid,create_time_begin,create_time_end);
		util.billConversion(sourceConn, targetConn, appid, accountid, create_time_begin,create_time_end);
		System.out.println("执行完成");
	}

}
